﻿using System.Collections.Generic;

namespace Sharp.Domain.Repositories
{
    /// <summary>
    /// 支持Sql模式
    /// </summary>
    public interface ISql
    {
        /// <summary>
        /// 执行Sql返回数据
        /// </summary>
        /// <typeparam name="TEntity"></typeparam>
        /// <param name="sqlQuery"></param>
        /// <param name="parameters"></param>
        /// <returns></returns>
        IEnumerable<TEntity> ExecuteQuery<TEntity>(string sqlQuery, params object[] parameters);
        /// <summary>
        /// 执行Sql
        /// </summary>
        /// <param name="sqlCommand"></param>
        /// <param name="parameters"></param>
        /// <returns></returns>
        int ExecuteCommand(string sqlCommand, params object[] parameters);
    }
}
